#ifndef _BASIC_SOLVER_H_
#define _BASIC_SOLVER_H_

#include "matrix.h"
#include <vector>

class BasicSolver {
public:
	typedef enum {
		ssNotStarted,
		ssNotSolvable,
		ssSolved
	} SolverState;
	
	BasicSolver();
	
	void setMatrix(const SquareMatrix &mat);
	void setFreeTerms(const std::vector<double> &vec);
	
	virtual void solve() = 0;
	
	SolverState state() const;
	std::vector<double> solution() const;

protected:
	SquareMatrix matrix;
	std::vector<double> freeTerms;
	std::vector<double> Xs;
	
	void setState(SolverState st);
	
private:
	SolverState _state;
};

#endif